﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="customermodify.aspx.cs" Inherits="member_customermodify" %>

<link rel="stylesheet" href="/Public/Home/chosen_v1.5.1/chosen.css" />
<link rel="stylesheet" href="/Public/Home/css/colorbox.css" />
    <style type="text/css">
    <!--
    .Validform_wrong{color:#F00;}
    .mit{width:120px;}
    .Upimg{margin-left:135px;}
    -->
    </style>
<div class="Member_content">
		<h1 class="member_iconTit">
	    	单位管理 > 修改单位
		</h1>
        <form id="form1" runat="server">
            <asp:textbox runat="server" ID="_id" type="hidden"></asp:textbox>
        <div class="msearch">
	    <ul class="member_inbig">
	    	<li class="mit">单位编号</li>
	        <li><asp:textbox ID="danwbh" CssClass="min win2" ReadOnly="true" runat="server"></asp:textbox></li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">单位名称</li>
	        <li><asp:textbox ID="dwmch" CssClass="min win_b3" ReadOnly="true" runat="server"></asp:textbox></li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">是否供应商</li>
	    	<li><asp:textbox ID="isjh" CssClass="min win2" ReadOnly="true" runat="server"></asp:textbox></li>
            <li class="mit">是否客户</li>
	    	<li><asp:textbox ID="isxs" CssClass="min win2" ReadOnly="true" runat="server"></asp:textbox></li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">联系人</li>
	        <li><asp:textbox ID="lxr" CssClass="min win2" ReadOnly="true" runat="server"></asp:textbox></li>
            <li class="mit">联系电话</li>
	        <li><asp:textbox ID="lxrdh" CssClass="min win2" ReadOnly="true" runat="server"></asp:textbox></li>
	    </ul>
	    <ul class="member_inbig">
	    	<li class="mit">联系地址</li>
	        <li><asp:textbox ID="dzhdh" CssClass="min win_b3" ReadOnly="true" runat="server"></asp:textbox></li>
	    </ul>
        <ul class="member_inbig">
            <li>
                <asp:literal ID="ResultDeBug" runat="server"></asp:literal>
            </li>
        </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">营业执照</li>
	        <li>
	        	<input type="button" value="上传" data-type="yyzz" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_yyzz">
            <asp:literal ID="yyzz" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">经营/生产许可证</li>
	        <li>
	        	<input type="button" value="上传" data-type="ypzlgf" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_ypzlgf">
                <asp:literal ID="ypzlgf" runat="server"></asp:literal>
	    </ul>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">GSP/GMP证书</li>
	        <li>                
	        	<input type="button" value="上传" data-type="gspzs" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_gspzs">
            <asp:literal ID="gspzs" runat="server"></asp:literal>
	     </ul>	        
	    <ul class="member_inbig">
	    	<li class="mit">质量保证协议</li>
	        <li>
	        	<input type="button" value="上传" data-type="zlbzxy" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_zlbzxy">
	        <asp:literal ID="zlbzxy" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">样张样票</li>
	        <li>
	        	<input type="button" value="上传" data-type="yzyp" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_yzyp">
	        <asp:literal ID="yzyp" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">发票样张</li>
	        <li>
	        	<input type="button" value="上传" data-type="fpyz" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_fpyz">
	        <asp:literal ID="fpyz" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">单位印章</li>
	        <li>
	        	<input type="button" value="上传" data-type="yinzhang" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_yinzhang">
	        <asp:literal ID="yinzhang" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">法人委托书</li>
	        <li>
	        	<input type="button" value="上传" data-type="frwts" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_frwts">
	        <asp:literal ID="frwts" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">被委托人身份证</li>
	        <li>
	        	<input type="button" value="上传" data-type="bwtrsfz" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_bwtrsfz">
	        <asp:literal ID="bwtrsfz" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">开户许可证</li>
	        <li>
	        	<input type="button" value="上传" data-type="khxkz" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_khxkz">
	        <asp:literal ID="khxkz" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">质量保证能力调查表</li>
	        <li>
	        	<input type="button" value="上传" data-type="zlbznldcb" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_zlbznldcb">
	        <asp:literal ID="zlbznldcb" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">单位变更记录</li>
	        <li>
	        	<input type="button" value="上传" data-type="dwbgjl" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_dwbgjl">
	        <asp:literal ID="dwbgjl" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">开票信息</li>
	        <li>
	        	<input type="button" value="上传" data-type="kpxx" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_kpxx">
	        <asp:literal ID="kpxx" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">蛋白同化制剂、肽类激素许可批件</li>
	        <li>
	        	<input type="button" value="上传" data-type="dbthxkpj" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_dbthxkpj">
	        <asp:literal ID="dbthxkpj" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">医疗机构执业许可证</li>
	        <li>
	        	<input type="button" value="上传" data-type="yljgzyxkz" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_yljgzyxkz">
	        <asp:literal ID="yljgzyxkz" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">医疗器械经营许可证</li>
	        <li>
	        	<input type="button" value="上传" data-type="ylqxjyxkz" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_ylqxjyxkz">
	         <asp:literal ID="ylqxjyxkz" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">食品经营许可证</li>
	        <li>
	        	<input type="button" value="上传" data-type="spltxkz" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_spltxkz">
	        <asp:literal ID="spltxkz" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">企业年度公示表</li>
	        <li>
	        	<input type="button" value="上传" data-type="qyndgsb" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_qyndgsb">
	        <asp:literal ID="qyndgsb" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">税务登记证</li>
	        <li>
	        	<input type="button" value="上传" data-type="swdlz" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_swdlz">
	        <asp:literal ID="swdlz" runat="server"></asp:literal>
	    </ul>
	        
	    <ul class="member_inbig">
	    	<li class="mit">合同</li>
	        <li>
	        	<input type="button" value="上传" data-type="hetong" class="upload-camera update updateB1">
	        </li>
	    </ul>
	    <ul class="Upimg" id="prview_hetong">
	        <asp:literal ID="hetong" runat="server"></asp:literal>
	    </ul>
            </div>
    </form>
</div>
<script type="text/javascript" src="/Public/Home/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" src="/Public/Home/webuploader/webuploader.withoutimage.min.js"></script>
<script src="/Public/Home/js/jquery.colorbox.js" type="text/javascript"></script>
<script src="/Public/Home/js/e-smart-zoom-jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
    function callbackfun(data, field) {
        $.dialog.tips('文件上传中...', 1, 'loading.gif', function () {
            var files = $('#' + field).val();
            var value = data.join(',');
            if (files.length > 0) {
                value = value + ',' + files;
            }
            $.each(data, function () {
                $('#prview_' + field).append('<li><span><img src="' + this + '"></span><em data-type="' + field + '"><img src="/Public/Home/images/close.png"></em></li>');
            });
            $('#' + field).val(value);
        });
    }
    $(function () {
        $('#modify-form').Validform({
            tiptype: function (msg, o, cssctl) {
                if (!o.obj.is("form")) {
                    var objtip = o.obj.closest("ul.member_inbig").find('li.tixin');
                    cssctl(objtip, o.type);
                    objtip.text(msg);
                }
            },
            btnSubmit: "#submit-modify-form",
            showAllError: true,
            ajaxPost: true,
            beforeSubmit: function (curform) {
                $('#submit-modify-form').text('保存中...');
                $.dialog.tips('数据提交中,请稍等...', 10, 'loading.gif');
            },
            callback: function (data) {
                $.dialog.tips(data.msg ? data.msg : '抱歉，系统错误，请稍后再试！', 2, data.code == 1 ? 'success.gif' : 'error.gif', function () {
                    window.location.reload();
                });
                return false;
            }
        });
        /*拍照上传开始*/
        $('.upload-camera').on('click', function () {
            var url, field = $(this).attr('data-type');
            var id = $('input[name="_id"]').val();
            var width = 965;
            url = '/base/customermodifyupload.aspx';
            $.dialog({
                title: "单位证照",
                width: width,
                height: 533,
                content: 'url:' + url + '?type=' + field+'&id='+id,
                padding: 0,
                lock: true,
                min: false,
                max: false,
                close: function () {
                    if (this.iframe.contentWindow.dcsObject) {
                        this.iframe.contentWindow.dcsObject.destroy();
                    }
                }
            });
            return false;
        });


        //删除
        $('.Upimg').on('click', 'em', function () {
            var file = $(this).closest('li').find('span img').attr('src');
            var field = $(this).attr('data-type');
            var image_id = $(this).attr('data-id');
            var id = $('input[name="_id"]').val();
            var files = $('#' + field).val();
            $.dialog.confirm('确定要删除该图片吗？', function () {
                $.dialog.tips('图片删除中,请稍等...', 100, 'loading.gif');
                $.ajax({
                    url: '/member/delfile.ashx',
                    type: "post",
                    data: { image_id: image_id },
                    dataType: 'json',
                    success: function (data) {
                        if (data.code == 1) {
                            $.dialog.tips(data.msg, 1, 'success.gif', function () {
                                $(this).closest('li').remove();
                                window.location.href = '/member/customermodify.aspx?id='+id;
                            });
                            return false;
                        } else {
                            $.dialog.tips(data.msg ? data.msg : '抱歉，系统错误，请稍后再试！', 2, 'error.gif');
                            return false;
                        }
                    },
                    error: function () {
                        $('#loadding').hide();
                        $.dialog.tips('抱歉，系统错误，请稍后再试！', 2, 'error.gif');
                    }
                });
            });            
            return false;
        });

        $('.Upimgxxxxx').on('click', 'em', function () {
            var file = $(this).closest('li').find('span img').attr('src');
            var field = $(this).attr('data-type');
            var files = $('#' + field).val();
            //var arrList = files.split(",");
            //arrList.splice(jQuery.inArray(file, arrList), 1);
            //$('#' + field).val(arrList.join(','));
            $(this).closest('li').remove();
            return false;
        });

        $('.Upimg').on('click', 'span', function () {
            var img = $(this).find('img').attr('src');
            var title = $(this).closest('ul').prev().find('li.mit').text();
            $.colorbox({ title: title, href: img, width: '80%', height: '100%', open: true });
        });
        $(document).bind('cbox_complete', function () {
            $("#cboxLoadedContent img").smartZoom();
        });
    });
</script>
<script type="text/javascript">
    $(document).ready(window.onresize = function () {
        //var whe = $(window).height();
        //$(".Member_left").css("height",whe-72);
        $('body').on('click', '.ajax-url', function () {
            var msg = '确定要执行该操作吗？';
            var url = $(this).attr('href');
            if ($(this).attr('data-msg')) {
                msg = $(this).attr('data-msg');
            }
            $.dialog.confirm(msg, function () {
                $.ajax({
                    url: url,
                    type: "post",
                    data: {},
                    dataType: 'json',
                    success: function (data) {
                        if (data.code == 1) {
                            $.dialog.tips(data.msg ? data.msg : '操作成功', 2, 'success.gif', function () {
                                window.location.reload();
                            });
                        } else {
                            $.dialog.tips(data.msg ? data.msg : '抱歉，系统错误，请稍后再试！', 2, 'error.gif');
                        }
                    },
                    error: function () {
                        $.dialog.tips('抱歉，系统错误，请稍后再试！', 2, 'error.gif');
                    }
                });
            });
            return false;
        });
        $('.logout').on('click', function () {
            var href = $(this).attr('href');
            $.dialog.confirm('您确定要退出登录吗？', function () {
                window.location.href = href;
            });
            return false;
        });
        if (!('placeholder' in document.createElement('input'))) {
            $('input[placeholder],textarea[placeholder]').each(function () {
                var that = $(this),
                text = that.attr('placeholder');
                if (that.val() === "") {
                    that.val(text).addClass('placeholder');
                }
                that.focus(function () {
                    if (that.val() === text) {
                        that.val("").removeClass('placeholder');
                    }
                })
                .blur(function () {
                    if (that.val() === "") {
                        that.val(text).addClass('placeholder');
                    }
                })
                .closest('form').submit(function () {
                    if (that.val() === text) {
                        that.val('');
                    }
                });
            });
        }
    });
</script>
</body>
</html>